import request from '@/utils/request';
// 查询健康档案疾病
export function getAssessDiseases() {
  return request({
    url: `/patients/physicalExamination/diseases`,
    method: 'get'
  });
}

export function sendPrescription(data) {
  return request({
    url: `/patients/hm/prescription`,
    method: 'post',
    noqs: true,
    data
  });
}
// 新增客户慢病记录
export function addChronic_disease(patientId, data) {
  return request({
    url: `/patients/${patientId}/chronic_disease`,
    method: 'post',
    noqs: true,
    data
  });
}
// 新建健康档案
export function addPhysicalExamination(patientId, data) {
  return request({
    url: `/patients/${patientId}/physicalExamination`,
    method: 'post',
    noqs: true,
    data
  });
}
// 一定天数内是否有健康档案
export function getIsPhysicalExamination(patientId, days) {
  return request({
    url: `/patients/${patientId}/isPhysicalExamination?days=${days}`,
    method: 'get'
  });
}
// 一定天数内是否有健康档案
export function getAssessDonecount() {
  return request({
    url: `/patients/physicalExamination/count`,
    method: 'get'
  });
}
// 健康评估结果查询
export function getAssessResult(patientId) {
  return request({
    url: `/smartriskmanagement/searchrisk?patientId=${patientId}`,
    method: 'get'
  });
}
// 查询患病现状，区分是否慢病人群
export function getAssessListNow(patientId) {
  return request({
    url: `/smartriskmanagement/riskelement?patientId=${patientId}`,
    method: 'get'
  });
}
// 健康指标评估 patients/{patientId}/healthIndex 单题提交
export function submitHealth(patientId, data) {
  return request({
    url: `/patients/${patientId}/healthIndex`,
    method: 'post',
    noqs: true,
    data
  });
}

// 获取健康评估报告列表
export function getAssessmentReports(patientId) {
  return request({
    url: `/assessment_reports?patientId=${patientId}&skip=0&limit=100`,
    method: 'get'
  });
}

export function getFamilyAssessmentReports(patientIdListStr) {
  return request({
    url: `/assessment_reports?patientIds=${patientIdListStr}&skip=0&limit=100`,
    method: 'get'
  });
}
// 查询健康风险评估报告详情
export function getAssessmentReportsInfo(id) {
  return request({
    url: `/assessment_reports/${id}`,
    method: 'get'
  });
}

// 健康报告已读
export function postRead(id) {
  return request({
    url: `/assessment_report/${id}/read`,
    method: 'POST'
  });
}

// 查询健康报告总数
/**
 * params:{
 *  patientId	string	会员ID
 *  hasRead	Boolean	是否已读 true=是 flase=否
 * }
 *
 */

export function reportAll(params) {
  return request({
    url: `/assessment_reports/count`,
    params,
    method: 'GET'
  });
}
